//
//  MAUserManager.m
//  MateAdv
//
//  Created by 茶 on 2023/9/20.
//

#import "MAUserManager.h"

@implementation MAUserManager

- (MAUserModel *)userModel {
    _userModel = nil;
    if (MAUserObj(kUserInfo)) {
        _userModel = [MAUserModel yy_modelWithJSON:MAUserObj(kUserInfo)];
    }
    return _userModel;
}

- (NSInteger)vipStatus {
    if (!MAUserObj(kUserInfo)) {
        return 0;
    }
    return self.userModel.vip_status.integerValue;
}

- (NSString *)userID {
    if (!MAUserObj(kUserInfo)) {
        return @"";
    }
    return [NSString stringWithFormat:@"%@", self.userModel.user_id];
}

- (NSString *)userToken {
    NSString *token = MAUserObj(kUserToken);
    return token;
}
@end
